<?

class Smutty_GPG_PublicKey {

	var $name, $keyId;

	function Smutty_GPG_PublicKey( $results ) {

		// contains names of properties, and a regexp
		// which will extract that prop from $results
		$props = array(
			name => '/: "(.+)" /',
			keyId => '/key ([A-Z0-9]+):/'
		);

		// extract properties from results
		foreach ( $props as $key => $regexp )
			foreach ( $results as $line )
				if ( preg_match($regexp,$line,$matches) )
					$this->$key = $matches[1];

	}

	function getKeyId() {
		return $this->keyId;
	}

}

?>